using UnityEngine;
using System.Collections;

public class PlayerManager  {

    private static PlayerManager _instance;
    public static PlayerManager Instance
    {
        get
        {
            if (_instance == null)
                _instance = new PlayerManager();

            return _instance;
        }
    }

    private string _currentLevel;
    private string _nextLevel;
    private int _nbStar = 0;
    private float _time;
    private float _timeStar3;
    private float _timeStar2;
    private float _timeStar1;
    

    // Use this for initialization
    private PlayerManager()
    {

    }
    
    //Set Result for current Level
    public void SetLevelResult(string level, int nbStar, float time, float timeStar3, float timeStar2, float timeStar1, string nextLevel)
    {
        _nbStar = nbStar;
        _time = time;
        _currentLevel = level;
        _timeStar1 = timeStar1;
        _timeStar2 = timeStar2;
        _timeStar3 = timeStar3;
        _nextLevel = nextLevel;
    }

    //Get Result of previous level
    public void GetLastLevelResult(out int nbStar, out float time, out float timeStar3, out float timeStar2, out float timeStar1, out string nextLevel)
    {
        nbStar = _nbStar;
        time = _time;
        timeStar1 = _timeStar1;
        timeStar2 = _timeStar2;
        timeStar3 = _timeStar3;
        nextLevel = _nextLevel;
    }

    public string GetLastLevelName()
    {
        return _currentLevel;
    }

}
